<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="a b c" style="color: red; background-color: rgb(204, 204, 204);" id="aa">
        内容文本
        <p itany="网博" style="color: red; background-color: rgb(204, 204, 204);">
            内容文本
            <span style="color: rgb(51, 51, 51);">提示信息</span>
        </p>
        内容文本
        <p>内容文本</p>
    </div>
</body>
<script>
    var pDom=document.querySelector("#aa");
    function createObj(pDom){
        var obj={};
        obj.tag=pDom.nodeName.toLowerCase();
        if(pDom.attributes){
            console.log(pDom.attributes);
            obj.attr={};
            for(var att of pDom.attributes){
                console.log(att);
                if(att="class"){
                    console.log(att.nodeValue);
                    // obj.attr.class=att.nodeValue.split(" ")
                }
            }
        }
        console.log(obj);
    }
    createObj(pDom);
</script>
</html>